<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
<HTML
><HEAD
><TITLE
> warcclient </TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
REL="HOME"
TITLE=" warc-tools version 0.17  A library for data archiving "
HREF="index.html"><LINK
REL="UP"
TITLE=" Detailed utilisation "
HREF="c126.html"><LINK
REL="PREVIOUS"
TITLE=" warcserver "
HREF="x206.html"><LINK
REL="NEXT"
TITLE=" mod_apache "
HREF="x287.html"></HEAD
><BODY
CLASS="sect1"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>warc-tools version 0.17  A library for data archiving</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="x206.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
>Chapter 3. Detailed utilisation</TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="x287.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="sect1"
><H1
CLASS="sect1"
><A
NAME="AEN222"
>3.6. warcclient</A
></H1
><P
>&#13;        The option -i -p  and -s are mandatory, the client makes request  to the located server at
        the address  specified as argument of the -i option, on the port specified after -p. the option -s indicates for which kind server the request is sent to: the server may be a warcserver (launched by the command warcserver), an apache2 server with a mod_warc module, a lighttpd-cgi server using a warc.cgi module or a lighttpd-fcgi server using a warc.fcgi module.
        <P
></P
><UL
><LI
STYLE="list-style-type: disc"
><P
>&#13;		If you connect to a warcserver (launched by the command warcserver on the same IP address and port), the server name in this case is warcserver
		</P
></LI
><LI
STYLE="list-style-type: disc"
><P
>&#13;        If you want to connect to Apache server (configuration of Apache server is shown in 
        section mod_apache) server name in this case is apache.
        </P
></LI
><LI
STYLE="list-style-type: disc"
><P
>&#13;        If you want connect to lighttpd server ( Configuration of lighttpd server is
        show in section mod_lighttpd) server name in this case is lighttpd-cgi or
        lighttpd-fcgi ( for cgi and fastcgi support respectively).
        </P
></LI
></UL
>
        </P
><P
> 
        The option -t and -o are mandatory, the option -t must preceed the name of WARC
        file that the client want to get from server. Option -o must preceed the file
        name desired in the client machine.
        </P
><P
>&#13;        The option -f gives the value  of the offset in warc file from where we start the transfer. The
        offset is  the beginning of the WARC Record to get in WARC file. If you do not pass -f to the command offset by default is zero. 
        </P
><P
>&#13;        The option -r is used to indicate that the whole WARC file is required, and the transfer will start from the indicated offset.
        </P
><P
> 
        The result obtained when  you want to get file or record are not filtered. If you
        want to have filtered WARC files, you can use options -u, -n or -d.
        <P
></P
><OL
TYPE="i"
><LI
><P
>&#13;        Use the option -u to filter on the WARC_TARGET_URI field, it comes before the string which represents the filter.
        </P
></LI
><LI
><P
>&#13;        Use the option -n to filter on the Content-Type field, it comes before the string which represents the filter.
        </P
></LI
><LI
><P
>&#13;        Use the option -d to filter on WARC-Type field, it comes before the string which represents the filter.
		If you specifies nothing after -d the value of filter is "unknown".
        </P
></LI
><LI
><P
>&#13;		Use the option -l to get the list of the WARC Redords stored in the required WARC file. In this case, the output file will be used to store this list which can be written into four possible formats: html, xml, text and json. each element of the list will give some information on the concerned WARC Record like its rank, offset, its header, etc.
		</P
></LI
></OL
>
        </P
><P
>&#13;        There are examples that show how to use warcclient command
        </P
><DIV
CLASS="example"
><A
NAME="AEN246"
></A
><P
><B
>Example 3-10.  How to use the warcclient to get a WARC Record. </B
></P
><PRE
CLASS="screen"
>&#13;<SAMP
CLASS="prompt"
>mohamed@mohamed-desktop:~$ </SAMP
><KBD
CLASS="userinput"
>warcclient  -i  192.168.1.6 -p 8080 -s warcserver \
                                -t  test.warc -o vertest.warc  -f 0 </KBD
>
        </PRE
><P
>&#13;        In this case, we are sending a request to a warcserver, at IP address 192.168.1.6 whith
        the listening port 8080, to get record that begins at the offset 0 in the WARC file test.warc.
        The name of the returned file is vertest.warc in the client machine.
        </P
></DIV
><DIV
CLASS="example"
><A
NAME="AEN252"
></A
><P
><B
>Example 3-11.  How to use the warcclient to get a WARC file. </B
></P
><PRE
CLASS="screen"
>&#13;<SAMP
CLASS="prompt"
>mohamed@mohamed-desktop:~$ </SAMP
><KBD
CLASS="userinput"
>warcclient  -i  192.168.1.6 -p 8080 -s apache2  \
                                -t test.warc -o vertest.warc  -f 0 -r </KBD
>
        </PRE
><P
>&#13;        This request is similar to previous one, but here we send it to an apache2 server with a mod_warc module, and we want to get the whole 
		WARC file from offset 0.
        </P
></DIV
><DIV
CLASS="example"
><A
NAME="AEN258"
></A
><P
><B
>Example 3-12.  How to use the warcclient to get a filtered WARC file. </B
></P
><PRE
CLASS="screen"
>&#13;<SAMP
CLASS="prompt"
>mohamed@mohamed-desktop:~$ </SAMP
><KBD
CLASS="userinput"
>warcclient  -i  192.168.1.6 -p 8080 -s warcserver\
                                -t  test.warc -o vertest.warc  -f 0 -n gif </KBD
>
        </PRE
><P
>&#13;        This request is similar to previous requests but in this case we want to get the WARC file
        from offset 0 including only the WARC Records whose Content-Type field  contains the string <KBD
CLASS="userinput"
>"gif"</KBD
>.
        </P
></DIV
><DIV
CLASS="example"
><A
NAME="AEN265"
></A
><P
><B
>Example 3-13.  How to use warcclient to get the records list. </B
></P
><P
>&#13;			To get the lising of the WARC Records stored in the wanted WARC file using an apache2 server, we may proceed like the following. Her, we've chose the <KBD
CLASS="userinput"
>xml</KBD
> output format. It is possible also to use <KBD
CLASS="userinput"
>html</KBD
>, <KBD
CLASS="userinput"
>text</KBD
> and <KBD
CLASS="userinput"
>json</KBD
>
        </P
><PRE
CLASS="screen"
>&#13;<SAMP
CLASS="prompt"
>mohamed@mohamed-desktop:~$ </SAMP
><KBD
CLASS="userinput"
>warcclient  -i  192.168.1.6 -p 8080 -s apache \
                                -t  test.warc -o vertest.warc  -f 0 -l xml</KBD
>
        </PRE
></DIV
><P
>&#13;        In the same way, we can use mod_lighttpd by using supported cgi or fastcgi modules by
        typing in the case where we want to use cgi:
        </P
><DIV
CLASS="example"
><A
NAME="AEN276"
></A
><P
><B
>Example 3-14.  How to use warcclient with lighttpd server using cgi module. </B
></P
><PRE
CLASS="screen"
>&#13;<SAMP
CLASS="prompt"
>mohamed@mohamed-desktop:~$ </SAMP
><KBD
CLASS="userinput"
>warcclient -i 192.168.1.6 -p 8080 -s lighttpd-cgi \
                                -t  test.warc -o vertest.warc  -f 0 -l xml</KBD
>
        </PRE
><P
>&#13;        And in the case where we want to use fastcgi:
        </P
></DIV
><DIV
CLASS="example"
><A
NAME="AEN282"
></A
><P
><B
>Example 3-15.  How to use warcclient with lighttpd using fastcgi module. </B
></P
><PRE
CLASS="screen"
>&#13;<SAMP
CLASS="prompt"
>mohamed@mohamed-desktop:~$ </SAMP
><KBD
CLASS="userinput"
>warcclient -i 192.168.1.6 -p 8080 -s lighttpd-fcgi \
                                 -t  test.warc -o vertest.warc  -f 0 -l xml</KBD
>
       </PRE
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="x206.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="x287.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>warcserver</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="c126.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>mod_apache</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>